class Solution(object):
    def partition(self, s):
        """
        :type s: str
        :rtype: List[List[str]]
        """
        res = []

        def find(start, arr):
            if start == len(s):
                res.append(arr)
            print(start, arr)
            for i in range(start, len(s)):
                string = s[start : i + 1]
                if string == string[::-1]:
                    print("--", string)
                    find(i + 1, [*arr, string])

        find(0, [])
        return res


if __name__ == "__main__":
    res = Solution().partition("aabb")
    print(res)
